<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2023 yoncron All rights reserved.
// +----------------------------------------------------------------------
// | Author: yoncron <yoncron@163.com>
// +----------------------------------------------------------------------
namespace app\controller;

use app\common\Util;
use app\service\Route;
use support\Request;

class Index
{
    /**
     * description: 默认首页
     * @Route(reqUrl="/")
     * author:yangkelong
     * data:2021/10/28
     */
    public function index(Request $request)
    {
        $client_ip = $request->getRealIp($safe_mode=true);
        Util::send_console_msg($client_ip.' access index.');
        return "您的请求被禁止。";
    }

    /**
     * description:
     * @Route(reqUrl="/console")
     * author:yangkelong
     * data:2021/12/20
     */
    public function console(){
        $socket_host =getenv('SOCKET_HOST');
        return view('index/console', ['socket_host' => $socket_host]);
    }

    /**
     * description:
     * @Route(reqUrl="/error")
     * author:yangkelong
     * data:2021/12/20
     */
    public function error(){
        $socket_host =getenv('SOCKET_HOST');
        return view('index/error', ['socket_host' => $socket_host]);
    }

}
